<?php

require "admin/config/mysql.php";

class indexModel
{
    public static function getIndex()
    {
        $pdo = mysqlPdo::getPdoConnect();
        $kid = empty($_GET["id"]) ? 1 : $_GET["id"];
        $re1 = $pdo -> query("select id,title,kid from article_content where kid = $kid order by id asc");
        $res1 = $re1 -> fetchALL(PDO::FETCH_ASSOC);
        return $res1;
       
    }

    public static function getKind()
    {
        $pdo = mysqlPdo::getPdoConnect();
        $re = $pdo -> query("select * from article_kind order by id");
        $re -> setFetchMode(PDO::FETCH_ASSOC);
        $res = $re -> fetchALL();
        return $res;
    }
}

